using System;
using System.Linq;
using System.Linq.Expressions;
using Home.Site.Models.Account;
using Home.Site.Models.WebUI;

namespace Home.Site.Models.DataLayer
{
    public interface IReviewRepository : IDisposable    
    {
        IQueryable<Review> All { get; }
        IQueryable<Review> AllIncluding(params Expression<Func<Review, object>>[] includeProperties);
        Review Find(int id);
        void InsertOrUpdate(Review review);
        void Delete(int id);
        void Save();
        IQueryable<Review> GetReviewByCategory(CategoryTypes type);
        IQueryable<ReviewCategory> GetCategories();
        Review[] GetLastReviewByCategory(CategoryTypes type, int count);
        Review Build(ReviewViewModel review);
        IQueryable<Review> FilterByTitle(CategoryTypes type, string searchText);
        IQueryable<Review> Sort(SortTypes sortType, CategoryTypes type, string order);
        IQueryable<Review> GetReviewByUser(string user);
    }
}